home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Microsoft Programmer's Library
/
Microsoft Programmer's Library (CD-ROM Database)(125-099-008)(Version 1.1a)(CDRM 162100)(1989).iso
/
SAMPCODE
/
OS2SDK11
/
TK4
/
OPENDLG
/
GPI.C
< prev
next >
Wrap
C/C++ Source or Header
|
1989-02-20
|
855b
|
24 lines
/***************************************************************************\
* GPI.C -- GPI Helper routines
* Created by Microsoft Corporation, 1989
\***************************************************************************/
#define INCL_GPI
#include "tool.h"
/***************************************************************************\
* GetTextExtent helper function
\***************************************************************************/
ULONG CALLBACK GetTextExtent(HPS hps, PCH lpstr, int cch) {
POINTL rgptl[TXTBOX_COUNT];
if (cch) {
GpiQueryTextBox(hps, (LONG)cch, lpstr, 5L, rgptl);
return(MAKEULONG((SHORT)(rgptl[TXTBOX_CONCAT].x - rgptl[TXTBOX_BOTTOMLEFT].x),
(SHORT)(rgptl[TXTBOX_TOPLEFT].y - rgptl[TXTBOX_BOTTOMLEFT].y)));
} else
return(0L);
}